<?php
    $get_max = $svo->doSQL("select distinct sponsor_banner from ".$table['Sponsoren'].";");
    $max = $svo->countRows($get_max);
    mt_srand((double)microtime()*1000000);
    $banner_id = mt_rand(1,$max);
    $banner_data = $svo->readRecordset("select * from ".$table['Sponsoren']." where sponsor_id='".$banner_id."';");
    $svo->doSQL("update ".$table['Sponsoren']." set banner_count='".($banner_data['banner_count']+1)."' where sponsor_id='".$banner_data['sponsor_id']."';");
    $banner_bild = "<img src=\"../images/sp/".$banner_data['sponsor_banner']."\" width=\"110\" height=\"200\" border=\"0\">";

    if (!empty($banner_data['sponsor_url'])) $banner = "<a href=\"../click.php5?link_id=".$banner_data['sponsor_id']."\" target=\"_blank\" onMouseOver=\"window.status='".$banner_data['sponsor_name']."';return true;\" onMouseOut=\"window.status='';return true;\">".$banner_bild."</a>";
    else $banner = $banner_bild;
?>
